package com.jdragon.tljrobot.client.entry;

import com.jdragon.tljrobot.client.config.FinalConfig;
import lombok.SneakyThrows;
import org.apache.commons.codec.binary.Hex;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import static java.nio.charset.StandardCharsets.UTF_8;

/**
 * Create by Jdragon on 2020.01.17
 */
public class NumState {
    public static int num;
    public static int rightNum;
    public static int misNum;
    public static int dateNum;

    @SneakyThrows(NoSuchAlgorithmException.class)
    public static String getNumKey() {
        byte[] data = (num + rightNum + misNum + dateNum + FinalConfig.SECRET).getBytes(UTF_8);
        return Hex.encodeHexString(MessageDigest.getInstance("MD5").digest(data));
    }
}
